<ion-view view-title="我的产品">
    <ion-nav-buttons side="left">
        <back-button></back-button>
    </ion-nav-buttons>
    <ion-content class="fund">

        <ion-refresher pulling-text={{PULLING_TEXT}} pulling-icon="" refreshing-text={{REFRESHING_TEXT}}
                       on-refresh="doRefresh()"></ion-refresher>

        <!--<ion-list>-->
        <div ng-repeat="item in shares">
            <div class="panel_head" ng-if="$first"  style="padding-top: 15px"><i class="icon_cStar"></i>{{item.fund_alias}}</div>
            <div class="panel_head" ng-if="!$first"><i class="icon_cStar"></i>{{item.fund_alias}}</div>
            <div class="panel">
                <div class="item">
                    <h2>{{item.prod_name}}</h2>
                    <div class="fr" ng-if="'2'!=item.prod_profit_mode">
                         <span ng-if="item.enableSell && (item.prod_status == 0 || item.prod_status == 2)" class="btn sell"
                               sell-button allot_no="{{item.allot_no}}" prod_code="{{item.prod_code}}" prod_source="{{item.prodSource}}">卖出</span>
                        <span ng-if="!item.enableSell && (item.prod_status == 0 || item.prod_status == 2)" class="btn sell disable">卖出</span>
                        <span ng-if="item.prod_status == 3" class="btn sell disable">暂停赎回</span>
                        <span ng-if="item.prod_status == 5" class="btn sell disable">封闭期</span>
                        <span ng-if="item.prod_status== 1" class="btn sell disable">暂停交易</span>
                    </div>
                    <p>{{item.bank_name}} {{item.pay_account}}</p>
                </div>

                <a ng-if="'0'==item.prod_profit_mode && 'dzxfund'!=item.prod_catalog_mark"
                   ng-href="#/tab/account-shareDetail?allotNo={{item.allot_no}}&prodCode={{item.prod_code}}&prodSource={{item.prodSource}}&enable_amount={{item.enable_amount}}&trans_account={{item.trans_account}}">
                    <ul class="income-items column-3 clearfix">
                        <li><em class="inc">{{(item.current_amount / 10000) * item.prod_gain | defNumber: 2 }}<sub>元</sub></em>{{param.prevDate}}收益</li>
                        <li><em class="inc">{{item.total_income | defNumber:2}}<sub>元</sub></em>累计收益</li>
                        <li><em>{{item.total_invest | defNumber:2}}<sub>元</sub></em>基金金额</li>
                    </ul>
                </a>

                <a ng-if="'0'==item.prod_profit_mode && 'dzxfund'==item.prod_catalog_mark"
                   ng-href="#/tab/account-shareDetailShort?allotNo={{item.allot_no}}&prodCode={{item.prod_code}}&prodSource={{item.prodSource}}&enable_amount={{item.enable_amount}}&payAccount={{item.pay_account}}&trans_account={{item.trans_account}}">
                    <ul class="income-items column-3 clearfix">
                        <li><em class="inc">{{(item.current_amount / 10000) * item.prod_gain | defNumber: 2 }}<sub>元</sub></em>{{param.prevDate}}收益</li>
                        <li><em class="inc">{{item.total_income | defNumber:2}}<sub>元</sub></em>累计收益</li>
                        <li><em>{{item.total_invest | defNumber:2}}<sub>元</sub></em>基金金额</li>
                    </ul>
                </a>
                <time class="item" ng-if="'0'==item.prod_profit_mode && 'dzxfund'==item.prod_catalog_mark && item.short_term_fund.length > 0">
                    <i class="icon_date"></i>
                    <i class="icon_more" ng-click="shortDetail(item.prod_code,item.trans_account,item.prodSource,item.pay_account)"
                       ng-show="item.short_term_fund.length > 1"></i>
                    可卖时间：{{item.short_term_fund[0].redeem_end_date}}
                    {{item.pay_account_empty ? " 9:00-15:00" : " 当日15:00前"}}
                </time>

                <a ng-if="'1'==item.prod_profit_mode"
                   ng-href="#/tab/account-shareDetailQDII?allotNo={{item.allot_no}}&prodCode={{item.prod_code}}&prodSource={{item.prodSource}}&trans_account={{item.trans_account}}">
                    <ul class="income-items column-3 clearfix">
                        <li><em class="{{item.total_income>=0 ? 'inc' : 'inc_'}}">{{item.total_income | defNumber:2}}<sub>元</sub></em>总盈亏</li>
                        <li><em class="{{item.rate>=0 ? 'inc' : 'inc_'}}">{{item.rate | defNumber:2}}<sub>%</sub></em>参考收益率</li>
                        <li><em>{{item.total_invest | number:2}}<sub>元</sub></em>基金金额</li>
                    </ul>
                </a>

                <a ng-if="'2'==item.prod_profit_mode"
                   ng-href="#/tab/account-shareDetailBank?allotNo={{item.allot_no}}&prodCode={{item.prod_code}}&prodSource={{item.prodSource}}&trans_account={{item.trans_account}}">
                    <ul class="income-items clearfix">
                        <li><em class="inc">{{item.reIncome | defNumber:2}}<sub>元</sub></em>预期收益</li>
                        <li><em>{{item.total_income| defNumber:2}}<sub>元</sub></em>总资产</li>
                    </ul>
                </a>
                <time ng-if="'2'==item.prod_profit_mode" class="item">
                    <i class="icon_date"></i><em><i class="icon_more" ng-click="redeemDetail(item.prod_code,item.prod_expire_date,item.bank_name,item.pay_account)"></i></em>到期时间：{{item.prod_expire_date | defDateString : 1}}，到期自动赎回</time>

                <a ng-if="'3'==item.prod_profit_mode"
                   ng-href="#/tab/account-shareDetailGather?allotNo={{item.allot_no}}&prodCode={{item.prod_code}}&prodSource={{item.prodSource}}">
                    <ul class="income-items column-3 clearfix">
                        <li><em class="{{item.total_income>=0 ? 'inc' : 'inc_'}}">{{item.total_income| defNumber:2}}<sub>元</sub></em>总盈亏</li>
                        <li><em class="{{item.rate>=0 ? 'inc' : 'inc_'}}">{{item.rate | defNumber:2}}<sub>%</sub></em>参考收益率</li>
                        <li><em>{{item.total_invest | defNumber:2}}<sub>元</sub></em>基金金额</li>
                    </ul>
                </a>
                <time class="item" ng-if="'3'==item.prod_profit_mode && param.sys_time == item.prod_expire_date">
                    <i class="icon_date"></i>
                    <i class="icon_more" ng-click="gatherDetail(item.shareDesc)" >
                    </i>到期时间{{item.prod_expire_date | defDateString : 1}}到期自动赎回
                </time>
                <time ng-if="'3'==item.prod_profit_mode && param.sys_time != item.prod_expire_date" class="item">
                    <i class="icon_date"></i><em ng-bind-html="item.shareDesc"></em>
                </time>
                <time class="item" ng-if="item.prod_status == 5">
                    <i class="icon_date"></i>目前处于封闭期，封闭期结束后可开放卖出
                </time>
            </div>
        </div>
        <!--</ion-list>-->
        <div class="little-tip ng-hide" ng-show="param.isLoaded" style="margin-top: 10px" ng-if="shares.length == 0">购买订单提交后请在交易记录中查询该订单状态，待购买确认后可在“我的产品”查询。</div>
        <div class="little-tip ng-hide" ng-show="param.isLoaded" ng-if="shares.length != 0">购买订单提交后请在交易记录中查询该订单状态，待购买确认后可在“我的产品”查询。</div>
    </ion-content>
</ion-view>